package com.ishadows.notebook.dialog;

import android.app.Dialog;
import android.content.Context;
import android.widget.Button;
import android.widget.EditText;

import com.ishadows.notebook.R;

public class CustomTextInput extends Dialog{
	private EditText editText;
	private Button sure;
	private Button cancel;
	public CustomTextInput(Context context) {
		super(context,android.R.style.Theme_Holo_Dialog);
		this.setContentView(R.layout.dialog_edit);
		editText=(EditText) this.findViewById(R.id.dialog_text_input);
		cancel=(Button) findViewById(R.id.dialog_cancel_btn);
		sure=(Button) findViewById(R.id.dialog_sure_btn);
		// TODO Auto-generated constructor stub
		setCanceledOnTouchOutside(true);
	}
	
	public String getText(){
		return editText.getText().toString();
	}
	
	
	public void setInputType(int type){
		editText.setInputType(type);
	}
	public void setSureClick(android.view.View.OnClickListener onClickListener){
		//sure.setOnClickListener(l)
		sure.setOnClickListener(onClickListener);
	}
	public void setCancelClick(android.view.View.OnClickListener onClickListener){
		//sure.setOnClickListener(l)
		cancel.setOnClickListener(onClickListener);
	}
	

}
